package com.jonas.test.dao;

import com.jonas.test.bean.User;
import org.springframework.jdbc.core.RowMapper;

import java.sql.ResultSet;
import java.sql.SQLException;

/**
 * Created by yzYang on 2015/1/26.
 */
public class UserMapper implements RowMapper<User> {
    @Override
    public User mapRow(ResultSet rs, int rowNum) throws SQLException {
        User u = new User();
        u.setId(rs.getString("id"));
        u.setName(rs.getString("username"));
        u.setRole_id(rs.getString("role_ids"));

        return u;
    }

}
/*


CREATE TABLE sys_user
        (
                id BIGINT PRIMARY KEY NOT NULL AUTO_INCREMENT,
                organization_id BIGINT,
                username VARCHAR(100),
    password VARCHAR(100),
    salt VARCHAR(100),
    role_ids VARCHAR(100),
locked TINYINT DEFAULT 0
        );
*/

